package houmen;

import java.awt.Component;

import javax.swing.JFileChooser;


@SuppressWarnings("serial")
public class FileSelector extends JFileChooser{
	public FileSelector(Component parent) {
		JFileChooser chooser = new JFileChooser();
//        FileNameExtensionFilter filter = new FileNameExtensionFilter(
//            "JPG & GIF Images", "jpg", "gif");
//        chooser.setFileFilter(filter);
        int returnVal = chooser.showOpenDialog(parent);
        if(returnVal == JFileChooser.APPROVE_OPTION) {
           System.out.println("You chose to open this file: " +
                chooser.getSelectedFile().getName());
        }
	}
}
